# import unittest
# import testDemo1
# import testDemo2
# import testDemo3
# import testDemo4
#
# if __name__ == '__main__':
#     # 创建测试套件
#     suit = unittest.TestSuite()
#     # 创建加载器
#     loader = unittest.TestLoader()
#     # 测试套件中添加测试用例
#     suit.addTests([loader.loadTestsFromModule(testDemo1),
#                    loader.loadTestsFromModule(testDemo2),
#                    loader.loadTestsFromModule(testDemo3),
#                    loader.loadTestsFromModule(testDemo4)])
#     # 执行测试套件
#     unittest.TextTestRunner().run(suit)


import unittest
import unittestreport


if __name__ == '__main__':
    # 创建测试套件
    # 获取当前目录下以test开头的.py文件
    suit = unittest.TestLoader().discover("./case", "test*.py")
    runner = unittestreport.TestRunner(
        suite=suit,
        tester='坚果',
        filename='report-坚果.html',
        report_dir=r'.\reports',
        title='坚果的测试报告',
        desc='报告描述',
        templates=1
    )
    runner.run(count=3, interval=3, thread_count=3)
